export function getJsonTree(data: any, parentId: any) {
  var itemArr = [];
  for (var i = 0; i < data.length; i++) {
    var node = data[i];
    // console.log(node);
    if (node.parentId == parentId) {
      var newNode = {} as any;
      newNode.id = node.id;
      newNode.name = node.name;
      newNode.isShow = node.isShow;
      newNode.keepAlive = node.keepAlive;
      newNode.orderNum = node.orderNum;
      newNode.parentId = node.parentId;
      newNode.path = node.router;
      newNode.icon = node.icon;
      newNode.perms = node.perms;
      newNode.type = node.type;
      if (node.type < 1) {
        newNode.children = getJsonTree(data, node.id);
      }
      itemArr.push(newNode);
    }
  }
  return itemArr;
}